﻿using System.Net;
using System.Security.Authentication;
using WeDonekRpc.Helper.Validate;

namespace Basic.FlowRemoteModel.EventTemplate.Model
{
    public class HttpInterConfig
    {
        /// <summary>
        /// 请求的完整URI
        /// </summary>
        [NullValidate("flow.event.http.uri.null")]
        public string Uri
        {
            get;
            set;
        }

        /// <summary>
        /// Http配置
        /// </summary>
        public HttpConfig Config
        {
            get;
            set;
        }
    }
    public class HttpConfig
    {
        /// <summary>
        /// 获取或设置一个值，该值指示处理程序是否应跟随重定向响应。
        /// </summary>
        public bool AllowAutoRedirect { get; set; } = false;

        /// <summary>
        /// 获取或设置 HttpClientHandler 对象管理的 HttpClient 对象所用的 TLS/SSL 协议。
        /// </summary>
        public SslProtocols SslProtocols { get; set; } = SslProtocols.Tls12;

        /// <summary>
        /// 获取或设置处理程序用于自动解压缩 HTTP 内容响应的解压缩方法类型。
        /// </summary>
        public DecompressionMethods AutomaticDecompression { get; set; } = DecompressionMethods.None;

        /// <summary>
        /// 获取或设置处理程序遵循的重定向的最大数目。
        /// </summary>
        public int MaxAutomaticRedirections { get; set; } = 2;
    }
}
